package com.mediacloud.app.newsmodule.activity.audio

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.mediacloud.app.assembly.util.load
import com.mediacloud.app.assembly.util.loadX
import com.mediacloud.app.newsmodule.R
import com.tencent.liteav.demo.superplayer.model.entity.AlbumRecommend
import com.tencent.liteav.demo.superplayer.model.entity.SeriesRecommendDto
import com.mediacloud.app.assembly.util.loadX
import com.mediacloud.app.assembly.util.loadXWithRadiusGlide
import com.mediacloud.app.reslib.enums.AppFactoryGlobalConfig

class GridAudioAlbumRecommendAdapter :
    BaseQuickAdapter<AlbumRecommend, BaseViewHolder>(R.layout.item_audio_album_list_recommend2) {
    var radius = 0
    override fun convert(helper: BaseViewHolder, item: AlbumRecommend?) {
        val audioAlbumLogo = helper.getView<ImageView>(R.id.audioAlbumLogo)
        val audioAlbumTitleTv = helper.getView<TextView>(R.id.audioAlbumTitleTv)

        if (radius == 0) {
            radius = mContext.resources.getDimensionPixelSize(R.dimen.dimen6)
        }
        audioAlbumLogo?.loadXWithRadiusGlide(item?.albumDto?.logo, radius, AppFactoryGlobalConfig.getDefaultImageLoadDrawable())
        audioAlbumTitleTv.text = "${item?.albumDto?.name}"
    }

}